package com.ifsaid.im.service;

import com.ifsaid.im.bo.LoginUser;
import com.ifsaid.im.common.service.IBaseService;
import com.ifsaid.im.entity.UserEntity;
import com.ifsaid.im.exception.UserException;

import java.util.Set;

/**
 * @description: 用户 service 层
 * @author: Wang Chen Chen <932560435@qq.com>
 * @date: 2019/4/18 11:45
 * @version: 1.0
 */

public interface IUserService extends IBaseService<Integer, UserEntity> {

    /**
     * @description: 根据用户名获取用户信息
     * @date: 2019/11/4 13:58
     */
    UserEntity findUserByUsername(String username);

    /**
     * @description: 注册用户
     * @date: 2019/11/4 14:52
     */
    UserEntity registered(UserEntity entity) throws UserException;

    /**
     * @description: 登录
     * @date: 2019/11/4 14:52
     */
    LoginUser login(String username, String password) throws UserException;

    /**
     * @description: 获取某个用户的 朋友列表
     * @date: 2019/11/4 13:58
     */
    Set<UserEntity> findFriendList(Integer myId);

    /**
     * @description: 添加好友
     * @date: 2019/11/4 13:58
     */
    void addFriend(Integer myid, String friendName);


}
